Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Printing Extensions and Drivers /
Chapter 3 - Printer Drivers / Color Printing


Color Matching

Macintosh system software includes ColorSync, which provides color matching for drivers and applications. Color matching is the process that allows different devices
to display the same color, providing the user with an accurate color representation in
a device-independent manner.

You can provide color matching in your QuickDraw GX printer drivers without overriding any messages or calling any functions. All that you need to do is provide at least one color profile ('prof') resource in your driver. These resources, each of which describes how colors are represented on a specific device, are described in Inside Macintosh: Advanced Color Imaging. Although many printer drivers need only one color profile resource, you can define more than one such resource for your driver. Each profile can be associated with a specific page format or paper type. For example, the Apple Color Printer driver defines color profiles for three different media types that affect the appearance of color: coated paper, transparency film, and plain paper.

When you define a color profile resource for your printer driver, QuickDraw GX reads the resource data, creates a color profile object from the data, and associates that object with your printing device. If you want to create a color profile dynamically, you can override the GXFetchTaggedData message, which QuickDraw GX uses to read the resource data. The GXFetchTaggedData message is described on page page 4-45 in the chapter "Printing Messages."

An application program can call the GXFindPrinterProfile function to query your printer driver. When an application calls this function, QuickDraw GX sends the corresponding GXFindPrinterProfile message. You can override this message to return to the application which profile you want to use. The application can then call the GXSetPrinterProfile function to change this information. Once again, QuickDraw GX sends the corresponding message--in this case, the GXSetPrinterProfile message. You can also override this message in your printer driver.

An application program can also call the GXFindFormatProfile function to query your printer driver to find out which color profile is used for a specific page format. When an application calls this function, QuickDraw GX sends the corresponding GXFindFormatProfile message. You can override this message to return to the application which profile you want to use. The application can then call the GXSetFormatProfile function to change this information. Once again, QuickDraw GX sends the corresponding message--in this case, the GXSetFormatProfile message. You can also override this message in your printer driver.

The GXFindPrinterProfile, GXSetPrinterProfile, GXFindFormatProfile, and GXSetFormatProfile message are described in the section "Color Profile Messages" beginning on page 4-62. The corresponding functions that cause these messages to be sent are described in Inside Macintosh: QuickDraw GX Printing.

If the application is changing color profiles on a per-format basis, you also need to override the GXImagePage message. One of the parameters for this message is a handle to imaging-system-specific data, which contains a handle to a color profile. In your override, you need to change which color profile the handle points to and forward message. The GXImagePage message is described on page 4-94 in the chapter "Printing Messages."


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help